#include "IntBitSet.h"
#include "IntListSet.h"

void print(IntSet *s, int min, int max){
	bool first=true; 
	putchar('{'); 

	for(int e=min; e<=max ;++e) 
		if (s->contains(e)){ 
			if (first)  first=false; 
			else putchar(';'); 

			printf("%d",e); }
		printf("}\n");
}

void print(IntSet * s) { 
	putchar('{'); 
	IntIterator *it = s->newIterator(); 	
	if (it->hasNext())
		printf("%d",it->next()); 
	
	while( it->hasNext() ) 
		printf(";%d",it->next()); 
	
	delete it; 
	printf("}\n"); 
}


int main(){
    IntSet *b  = NULL;
	int option = 2;

	switch(option){
		case 1:
            b = new IntBitSet(10,20);
			break;
		case 2:
			b = new IntListSet();
			break;
	}

  	  b->add(13); 
	  b->add(18); 
	  b->add(15); 

	  print(b,10,20); // {13;15;18} 
	  b->rem(15);
	  print(b,10,20); // {13;18}


	  print(b);

	delete b;

	return 0;
}